const order = function (Mock) {
    function getOrder() {
        let orderList = Mock.mock({
            'array|10': [{
                'id': '@id',
                'storeId': '@id',
                'storeName': '@cword(5, 10)',
                'totalPrice': '@integer(1, 100)',
                'commodityList': Mock.mock({
                    'array|1-3': [{
                        'id': '@id',
                        'name': '@cword(5, 10)',
                        'price': '@float(1,100, 1, 1)',
                        'number': '@integer(1, 10)',
                        'image': '@image("100x100", @color)',
                    }]
                }).array
            }]
        }).array

        return {
            orderList,
            code: 200
        }
    }

    Mock.mock(/\/order\/getOrder.*?/, 'post', getOrder)
}

export default order